require "Common/define"
for i, v in pairs(CtrlNames) do
    require("Controller/" .. v)
end

CtrlManager = {};
local this = CtrlManager;
local ctrlList = {};    --控制器列表--

function CtrlManager.Init()
    logWarn("CtrlManager.Init----->>>");

    --ctrlList[CtrlNames.Prompt] = PromptCtrl.New()
    ctrlList[CtrlNames.Message] = MessageCtrl.New()
    ctrlList[CtrlNames.Login] = LoginCtrl.New()
    --ctrlList[CtrlNames.Agreement] = AgreementCtrl.New()
    ctrlList[CtrlNames.GameHall] = GameHallCtrl.New()
    ctrlList[CtrlNames.Rule] = RuleCtrl.New()
    --ctrlList[CtrlNames.Setting] = SettingCtrl.New()
    --ctrlList[CtrlNames.RoomTypeSelect] = RoomTypeSelectCtrl.New()
    ctrlList[CtrlNames.CreateRoom] = CreateRoomCtrl.New()
    ctrlList[CtrlNames.JoinRoom] = JoinRoomCtrl.New()

    ctrlList[CtrlNames.LoadingScene] = LoadingSceneCtrl.New()
    --ctrlList[CtrlNames.PopupConfirmationBox] = PopupConfirmationBoxCtrl.New()
    --ctrlList[CtrlNames.PopupInfoBox] = PopupInfoBoxCtrl.New()
    --ctrlList[CtrlNames.PopupWait]=PopupWaitCtrl.New()

    ctrlList[CtrlNames.WSKGameDesk] = WSKGameDeskCtrl.New()
    --ctrlList[CtrlNames.SGSetting] = SGSettingCtrl.New()
    ctrlList[CtrlNames.WSKPlayers] = WSKPlayersCtrl.New()
    --ctrlList[CtrlNames.SGVoteDel] = SGVoteDelCtrl.New()
    --ctrlList[CtrlNames.DailyTask]=DailyTaskCtrl.New()
    --ctrlList[CtrlNames.GameRecord]=GameRecordCtrl.New()
    -- ctrlList[CtrlNames.RecordRoundDetail]=RecordRoundDetailCtrl.New()
    --ctrlList[CtrlNames.BuyGold]=BuyGoldCtrl.New()
    --ctrlList[CtrlNames.BuyDiamond]=BuyDiamondCtrl.New()
    --ctrlList[CtrlNames.PlayerInfo]=PlayerInfoCtrl.New()

    return this;
end

--添加控制器--
function CtrlManager.AddCtrl(ctrlName, ctrlObj)
    ctrlList[ctrlName] = ctrlObj;
end

--获取控制器--
function CtrlManager.GetCtrl(ctrlName)
    return ctrlList[ctrlName];
end

--移除控制器--
function CtrlManager.RemoveCtrl(ctrlName)
    ctrlList[ctrlName] = nil;
end

--关闭控制器--
function CtrlManager.Close()
    logWarn('CtrlManager.Close---->>>');
end